# coding:utf-8
# coding:utf-8
#dongnaopython coding:utf-8
dongnaopython# author: Eric(动脑学院EricQQ:2384363842) welcome
dongnaopython# Python学习交流群 602319259
dongnaopython
# 案例1: 随机产生彩票号码
# 案例2: 扑克牌洗牌

import random
# # num = random.randint(1, 100)
# # print(num)
# print(random.choices([1,2,3,4,5], k=3))
# print(random.choice([1,2,3]))
#
daletou_qian = [i for i in range(1,36)]
daletou_hou =[i for i in range(1,13)]
random_qian =random.choices(daletou_qian, k=5)
random_hou = random.choices(daletou_hou, k=2)
random_qian.sort()
random_hou.sort()
random_nums = random_qian+ random_hou
print(random_nums)

# 3. 产生扑克牌，随机洗牌, 斗地主
import random

# 2-10, J,Q,K,A '大王','小王'  54张牌
poker_num = [str(i) for i in range(2, 11)]
poker_color = ["红桃", "黑桃", "方块", "梅花"]
poker_str = ["J", "Q", "K", "A"]
poker_king = ['大王', '小王']

pokers = ["%s%s" % (i, j) for i in poker_color for j in poker_num + poker_str] + poker_king
print(pokers)
print(len(pokers))

# 随机洗牌
random.shuffle(pokers)
print(pokers)

personA = pokers[0:51:3]
personB = pokers[1:51:3]
personC = pokers[2:51:3]
last3 = poker_str[-3:]

print("personA:",personA)
print("personB:",personB)
print("personC:",personC)
print("last3:",last3)
